package com.itheima.huikebackend.utils;

import org.springframework.stereotype.Component;

import java.util.Random;

@Component
public class GenRandomYZM {
    private static Random r =new Random();

    public static String randomYZM(){
        StringBuffer sb = new StringBuffer();
        char [] englishCodeArray = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
        ,'0','1','2','3','4','5','6','7','8','9'};

        for (int i = 0; i < 8; i++) {
            char num= englishCodeArray[r.nextInt(englishCodeArray.length)];
            sb.append(num);
        }
        return String.valueOf(sb);
    }
}
